<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let obj = [
            { uname: '张三', score: 90, status: '1' },
            { uname: '李四', score: 10, status: '3' },
            { uname: '王五', score: 70, status: '2' },
        ]
        let newobj = {
            1: '优秀',
            2: '良好',
            3: '差劲',
        }
        // 如果1 显示优秀，如果是2 显示良好，3 显示差劲
        //效果如下 打印页面
        // 张三 优秀 
        // 李四 差劲
        // 王五 良好
        let obj1 = []
        obj.forEach(item => {
            console.log(item.status);
            item.status = newobj[item.status]
        });
        console.log(obj);
        obj.forEach(item => {
            document.write(`${item.uname}  ${item.status}<br>`)
        });
    </script>
</body>

</html>